package com.group.mall.service.Impl;

import com.group.mall.domain.DTO.AddressDTO;
import com.group.mall.domain.POJO.Address;
import com.group.mall.mapper.AddressMapper;
import com.group.mall.service.AddressService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class AddressServiceImpl implements AddressService {

    @Autowired
    private AddressMapper addressMapper;


    @Override
    public List<Address> getAddress(Long userId){
     return addressMapper.getAddress(userId);
    }

    @Override
     public void deleteAddress(Long id) {
         addressMapper.deleteAddress(id);
    }

    @Override
    public void addAddress(AddressDTO addressDTO) {
        addressMapper.addAddress(addressDTO);
    }



    @Override
    public void deleteAllAddress(Long userId) {
        addressMapper.deleteAllAddress(userId);
    }

    @Override
    public void updateAddress(AddressDTO addressDTO) {
         addressMapper.updateAddress(addressDTO);
    }


}
